package com.ruoyi.qbms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.qbms.mapper.QbmsRecordFavoriteMapper;
import com.ruoyi.qbms.domain.QbmsRecordFavorite;
import com.ruoyi.qbms.service.IQbmsRecordFavoriteService;

/**
 * 题库收藏记录Service业务层处理
 * 
 * @author zouhuu
 * @date 2022-10-19
 */
@Service
public class QbmsRecordFavoriteServiceImpl implements IQbmsRecordFavoriteService 
{
    @Autowired
    private QbmsRecordFavoriteMapper qbmsRecordFavoriteMapper;

    /**
     * 查询题库收藏记录
     * 
     * @param id 题库收藏记录主键
     * @return 题库收藏记录
     */
    @Override
    public QbmsRecordFavorite selectQbmsRecordFavoriteById(Long id)
    {
        return qbmsRecordFavoriteMapper.selectQbmsRecordFavoriteById(id);
    }

    /**
     * 查询题库收藏记录列表
     * 
     * @param qbmsRecordFavorite 题库收藏记录
     * @return 题库收藏记录
     */
    @Override
    public List<QbmsRecordFavorite> selectQbmsRecordFavoriteList(QbmsRecordFavorite qbmsRecordFavorite)
    {
        return qbmsRecordFavoriteMapper.selectQbmsRecordFavoriteList(qbmsRecordFavorite);
    }

    /**
     * 查询数量
     * @param qbmsRecordFavorite
     * @return
     */
    @Override
    public int selectNums(QbmsRecordFavorite qbmsRecordFavorite) {
        return qbmsRecordFavoriteMapper.selectNums(qbmsRecordFavorite);
    }

    /**
     * 新增题库收藏记录
     * 
     * @param qbmsRecordFavorite 题库收藏记录
     * @return 结果
     */
    @Override
    public int insertQbmsRecordFavorite(QbmsRecordFavorite qbmsRecordFavorite)
    {
        qbmsRecordFavorite.setCreateTime(DateUtils.getNowDate());
        return qbmsRecordFavoriteMapper.insertQbmsRecordFavorite(qbmsRecordFavorite);
    }

    /**
     * 修改题库收藏记录
     * 
     * @param qbmsRecordFavorite 题库收藏记录
     * @return 结果
     */
    @Override
    public int updateQbmsRecordFavorite(QbmsRecordFavorite qbmsRecordFavorite)
    {
        qbmsRecordFavorite.setUpdateTime(DateUtils.getNowDate());
        return qbmsRecordFavoriteMapper.updateQbmsRecordFavorite(qbmsRecordFavorite);
    }

    /**
     * 批量删除题库收藏记录
     * 
     * @param ids 需要删除的题库收藏记录主键
     * @return 结果
     */
    @Override
    public int deleteQbmsRecordFavoriteByIds(Long[] ids)
    {
        return qbmsRecordFavoriteMapper.deleteQbmsRecordFavoriteByIds(ids);
    }

    /**
     * 删除题库收藏记录信息
     * 
     * @param id 题库收藏记录主键
     * @return 结果
     */
    @Override
    public int deleteQbmsRecordFavoriteById(Long id)
    {
        return qbmsRecordFavoriteMapper.deleteQbmsRecordFavoriteById(id);
    }
}
